
import java.net.URL;
import java.net.URLConnection;
import java.io.*;
public class URLConnection1{
	public static void main(String[] args) throws Exception{
		URL url = new URL("http://weibo.com/login.php");
		URLConnection conn = url.openConnection();
		InputStream is = conn.getInputStream();
		OutputStream os = new FileOutputStream("C:/Users/Lenovo/Desktop/BasicJava-ShengSiYuan/out.txt");
		byte[] buffer = new byte[2048];
		int length = 0;
		while(-1 != (length = is.read(buffer,0,buffer.length))){
			os.write(buffer,0,length);
		}
		is.close();
		os.close();
	}
}